//
//  TalkTests.m
//  UnitTests
//
//  Created by Jiang on 2018/10/22.
//  Copyright © 2018 jiang. All rights reserved.
//

#import <XCTest/XCTest.h>

@interface TalkTests : XCTestCase

@end

@implementation TalkTests
- (void)testValidTalks{
    id <Talk>talk1 = [[NormalTalk alloc] initWitContent:@"content 10min"];
    XCTAssertTrue(talk1.verifyContent,@"合法");
    XCTAssertEqual(talk1.duration, 10, @"演讲时长");
    
    id <Talk>talk3 = [[NormalTalk alloc] initWitContent:@"content lightning"];
    XCTAssertEqual(talk3.duration, 5, @"时长");
    

}
- (void)testUnvalidTalks{
    id <Talk>talk4 = [[NormalTalk alloc] initWitContent:@"wrong content10min"];
    XCTAssertFalse(talk4.verifyContent,@"不合法");
    
    id <Talk>talk2 = [[NormalTalk alloc] initWitContent:@"wrong content"];
    XCTAssertFalse(talk2.verifyContent,@"不合法");
    
    id <Talk>talk5 = [[NormalTalk alloc] initWitContent:@"wrong content -10min"];
    XCTAssertFalse(talk5.verifyContent,@"不合法");
}

@end
